package com.ayit.klog;

import android.support.annotation.NonNull;

import java.io.File;
import java.io.FileDescriptor;
import java.io.FileWriter;
import java.io.IOException;

/***
 *
 * @Author lny
 * @CreateTime 2024年01月18日 20:18:35
 * @Description
 */
public class AutoFileWriter extends FileWriter {
    
    private File file;
    
    public AutoFileWriter(@NonNull File file, boolean append) throws IOException {
        super(file, append);
        this.file = file;
    }
    
    @Override
    public void write(@NonNull String str) throws IOException {
        super.write(str);
    }
    
    public File getFile() {
        return file;
    }
    
    @Override
    public void close() throws IOException {
        super.close();
        file = null;
    }
}
